#!/usr/bin/env bash
# bash <(curl -sLk https://gitee.com/uon/script/raw/master/shell/synology/cpuinfo.sh)

var_dir="/tmp/a3ff9b51-d73f-8b75-a27d-be3e2a66a360"
files=("https://gitee.com/uon/script/raw/master/shell/synology/ch_cpuinfo_3.3.1/ch_cpuinfo.sh"
    "https://gitee.com/uon/script/raw/master/shell/synology/ch_cpuinfo_3.3.1/ch_cpuinfo.tar"
    "https://gitee.com/uon/script/raw/master/shell/synology/ch_cpuinfo_3.3.1/LANG.txt"
)

[ ! -d "${var_dir}" ] && mkdir -p "${var_dir}"

cd "${var_dir}" || exit

for i in "${files[@]}"; do
    curl -fLO --retry 3 "$i"
done

bash "ch_cpuinfo.sh"

rm -rf "$var_dir"
